﻿/*----------------------------------------------------------------
 * 
 * 版权所有：Copyright (C) 2013
 * 
 * 文件名：PhotoConfiguration.cs
 * 文件功能描述：
 * 
 * 
 * 作 者：zhangq
 * 邮 箱：ifunnyface@outlook.com
 * 日 期：2013-03-04 16:03:38
 * 
 * 
 * 修改标识： Author
 * 修改描述： 相关描述
 * 
 * ---------------------------------------------------------------- */

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using DomainModel;

namespace Infrastructure.Mapper
{

    /// <summary>
    /// 
    /// </summary>
    public class PhotoConfiguration : EntityTypeConfiguration<PhotoInfo>
    {

        /// <summary>
        /// 
        /// </summary>
        public PhotoConfiguration()
        {
            ToTable("CTB_Photos");
            HasKey(m => m.PhotoId);
            Property(m => m.PhotoId).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            Property(m => m.AlbumId);
            Property(m => m.PhotoTitle).HasMaxLength(200);
            Property(m => m.UploadDate);
            Property(m => m.PhotoUrl).HasMaxLength(255);
            
            //HasRequired(m => m.Album).WithMany(m=>m.Photos).HasForeignKey(m => m.AlbumId);

        }

         
    }

}